package com.zs.blog.converter;


import com.zs.blog.model.dto.CategoryDTO;
import com.zs.blog.model.dto.CategoryEditDTO;
import com.zs.blog.model.entity.Category;
import com.zs.blog.model.vo.CategoryEditVO;
import com.zs.blog.model.vo.CategoryListVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;


/**
 * @Title: CategoryConverter
 * @Author zs
 * @Package com.zs.blog.converter
 * @Date 2024/10/27 16:59
 * @description: 分类相关的属性转换器
 */
@Mapper(componentModel = "spring")
public interface CategoryConverter {
    CategoryConverter INSTANCE = Mappers.getMapper(CategoryConverter.class);

    List<CategoryListVO> categoryDto2CategoryVo(List<CategoryDTO> categoryDTO);

    Category categoryEditDto2Category(CategoryEditDTO categoryEditDTO);

    CategoryEditVO category2CategoryEditVO(Category category);
}
